var application = {
	pending_completion_init : function(){
		$(document.search_form.group_code).on('change', function(event){
			application.get_group_user();
		});
	},
		
	get_group_user : function(){
		var elmt, postdata;
		
		elmt = document.search_form.group_code;
		postdata = 'group_code=' + encodeURIComponent(elmt.value);
		
		var callback = function(json){
            if(json.status == 'OK'){
            	
            	var html = '<option value=""></option>';
            	
            	for(var n in json.group_users){
            		var item = json.group_users[n];
            		html += '<option value="' + item.id + '">' + item.name + '</option>';
            	}
            	
            	$(document.search_form.group_user).html(html);
            	
            } else {
            	mapUI.jq_message(json.message, 10);
            }
        };
		
        var jq = {
            'method' : 'GET',
            'url' : jq_main_url + '/MyApp.do?dispatch=get_group_user',
            'postdata' : postdata
        };
		
        mapUI.jq_call(jq, callback);
	}	
};